package com.ruoyi.mall.app.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class WechatPayConfig {

//    public final static String appId="wxb351cb9e8740393f"; // 小程序appid
//    public final static String secret="4d153676a26131378094f4fde88d7fd3"; // 小程序appid
//    public final static String accessTokenhttps="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s"; // 小程序appid
//    public final static String webAccessTokenhttps="https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code"; // 小程序appid
//    public final static String mchId="1572670171";// 商户ID
//    public final static String mchKey="kt946iningCZKTIsBest012345678902";// 跟微信支付约定的密钥
//    public final static String uniformorder="https://api.mch.weixin.qq.com/pay/unifiedorder"; // 统一下单地址
//    public final static String notifyUrl="http://www.yourdomain.com/compere/api/notify"; // 支付回调地址
//    public final static String orderquery="https://api.mch.weixin.qq.com/pay/orderquery"; // 查询订单地址
//    public final static String refundUrl="https://api.mch.weixin.qq.com/secapi/pay/refund"; // 查询订单地址
//    public final static String tradeType="JSAPI"; // 支付方式

    @Value("${wx.appId}")
    private String appId;

    @Value("${wx.secret}")
    private String secret;

    @Value("${wx.accessTokenhttps}")
    private String accessTokenhttps;

    @Value("${wx.webAccessTokenhttps}")
    private String webAccessTokenhttps;

    @Value("${wx.mchId}")
    private String mchId;

    @Value("${wx.mchKey}")
    private String mchKey;

    @Value("${wx.paySignKey}")
    private String paySignKey;

    @Value("${wx.tradeType}")
    private String tradeType;

    @Value("${wx.notifyUrl}")
    private String notifyUrl;

    @Value("${wx.uniformorder}")
    private String uniformorder;

    @Value("${wx.refundUrl}")
    private String refundUrl;

    @Value("${wx.orderquery}")
    private String orderquery;

    // Getters
    public String getAppId() {
        return appId;
    }

    public String getSecret() {
        return secret;
    }

    public String getAccessTokenhttps() {
        return accessTokenhttps;
    }

    public String getWebAccessTokenhttps() {
        return webAccessTokenhttps;
    }

    public String getMchId() {
        return mchId;
    }

    public String getMchKey() {
        return mchKey;
    }

    public String getPaySignKey() {
        return paySignKey;
    }

    public String getTradeType() {
        return tradeType;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public String getUniformorder() {
        return uniformorder;
    }

    public String getRefundUrl() {
        return refundUrl;
    }

    public String getOrderquery() {
        return orderquery;
    }
}
